var flag = false
function frida_Memory1(pattern )
{
    console.log("\n特征码:" + pattern);
    //枚举内存段的属性,返回指定内存段属性地址
    var addrArray = Process.enumerateRanges("r--");

    for (var i = 0; i < addrArray.length; i++)
    {

        var addr = addrArray[i];if (addr.base.toString().indexOf('0x1')==-1)break
        console.log("---->:"+addr.base)
        Memory.scan(addr.base, addr.size, pattern,
            {
                onMatch: function (address, size)
                {


                        console.log('搜索到 ' + pattern + " 地址是:" + address.toString());
                        Memory.writeInt(address.add(4),4)
                        // flag = true


                },
                onComplete: function ()
                {
                    console.log("搜索完毕")
                }
            }
        );
    }
}


setInterval(function(){
   // if (!flag) 9E 3E 4E 38 00 00 00 00 00 00 00 00 00 00 00 ?? 00 00 00 02
   // frida_Memory1('00 00 00 ?? 00 00 00 02')
   // frida_Memory1('00 00 00 00 A? 00 00 00 02 00 00 00')

    frida_Memory1('02 00 00 00 01 00 00 00 64 00 00 00 01 00 00 01')

}, 5000)
//frida -U -f com.fuego.team --no-pause -l javaheap.js
//frida -U -f com.jiuwan.fzsy.aligames --no-pause -l shenyudl.js
//frida -U com.jiuwan.fzsy.aligames -l shenyudl.js
